package com.hackerrank.www.javap.Strings;

import java.util.Scanner;

/**
 * Created by 27340 on 2017/5/21.
 */
public class Rex {
    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        String s = scan.nextLine();
        // Write your code here.A-Za-z !,?._'@
        String[] arrays = s.split("[ .,?!'@_]+");
        System.out.println(arrays.length);
        if(s.length() > 400000 || s.length() == 0 ){
            System.out.println(0);
        }
        for(String str : arrays){
            System.out.println(str);
        }
        scan.close();
    }
}
